package com.agileboot.domain.bot.conversationRecord.db;

import com.agileboot.common.core.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@TableName("conversation_record")
@ApiModel(value = "ConversationRecordEntity对象", description = "会话记录表")
public class ConversationRecordEntity extends BaseEntity<ConversationRecordEntity> {

    @ApiModelProperty("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("问题文本")
    @TableField("spoken")
    private String spoken;

    @ApiModelProperty("原始问题文本")
    @TableField("raw_spoken")
    private String rawSpoken;

    @ApiModelProperty("提问者名称")
    @TableField("received_name")
    private String receivedName;

    @ApiModelProperty("QA所在群名")
    @TableField("group_name")
    private String groupName;

    @ApiModelProperty("QA群备注")
    @TableField("group_remark")
    private String groupRemark;

    @ApiModelProperty("房间类型")
    @TableField("room_type")
    private String roomType;

    @ApiModelProperty("是否@机器人")
    @TableField("at_me")
    private String atMe;

    @ApiModelProperty("消息类型")
    @TableField("text_type")
    private String textType;

    @ApiModelProperty("AI回答内容")
    @TableField("answer")
    private String answer;

    @ApiModelProperty("创建人ID")
    @TableField(value = "creator_id", fill = FieldFill.INSERT)
    private Long creatorId;

    @ApiModelProperty("创建人名称")
    @TableField("creator_name")
    private String creatorName;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新人ID")
    @TableField(value = "updater_id", fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Long updaterId;

    @ApiModelProperty("更新人名称")
    @TableField("updater_name")
    private String updaterName;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    @ApiModelProperty("是否删除（0=否，1=是）")
    @TableField("deleted")
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty("token 使用数")
    @TableField("token_use")
    private Long tokenUse;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
